/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package models.content;

import java.util.Iterator;
import java.util.Vector;

/**
 * @author Sergey and Julia
 *
 */
public class TFedDoc implements Iterable<Double> {
	private Integer catId;
	private Vector<Double> tfVec;

	
	public TFedDoc(Integer catId, Vector<Double> tfVec) {
			this.catId = catId;
		this.tfVec = tfVec; 

	}
	
	public Vector<Double> getCopy() {
		Vector<Double> copy = new Vector<Double>(this.tfVec.size());
		copy.addAll(this.tfVec);
		return copy;
	}
	
	public Double getTF(int termIndex) {
			return (termIndex < this.tfVec.size())?this.tfVec.elementAt(termIndex):0.0;
	}

	public Integer size() {
		return this.tfVec.size();
	}

	/**
	 * @return the catId
	 */
	public Integer getCatId() {
		return this.catId;
	}


	@Override
	public Iterator<Double> iterator() {
		return this.tfVec.iterator();
	}
}
